<?php
if (!defined('WEB_ROOT')) {
	exit;
}

// make sure a product id exists
if (isset($_GET['id']) && $_GET['id'] > 0) {
	$id = $_GET['id'];
} else {
	// redirect to index.php
	header('Location: index.php');
}

$sql = "SELECT dv.id, dv.madv, dv.tendv, dv.dienthoai_dv, dv.diadiem, dv.ngaythanhlap, dv.truong_id, qg_id, tenqg
        FROM donvi dv join quocgia qg on dv.qg_id = qg.id
		WHERE dv.id = $id and dv.truong_id is NULL and dv.hieu_luc > 0
		ORDER BY dv.id desc";
		
		$result = mysql_query($sql) or die('Không lấy được thông tin trường. ' . mysql_error());

$row = mysql_fetch_assoc($result);
extract($row);
?>
<div class="onecolumn">
				<div class="header">
					<span>Thông tin chi tiết trường</span>
				</div>
				<br class="clear"/>
				<div class="content">
					<form action="processSchool.php?action=addSchool" method="post" enctype="multipart/form-data" name="frmAddSchool" id="frmAddSchool">
					 <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" class="entryTable">
					  <tr> 
					   <td width="150" class="label">Mã trường</td>
					   <td class="content"><?php echo $madv; ?></td>
					  </tr>
					  <tr> 
					   <td width="150" class="label">Tên trường</td>
					   <td class="content"> <?php echo $tendv; ?></td>
					  </tr>
					  <tr> 
					   <td width="150" class="label">Điện thoại trường</td>
					   <td class="content"><?php echo $dienthoai_dv; ?> </td>
					  </tr>
					  <tr> 
					   <td width="150" height="36" class="label">Địa điểm</td>
					   <td class="content"><?php echo $diadiem; ?> </td>
					  </tr>
					  <tr> 
					   <td width="150" class="label">Ngày thành lập</td>
					   <td class="content"><?php echo $ngaythanhlap; ?> </td>
					  </tr>
					  <tr> 
					   <td width="150" class="label">Quốc gia</td>
					   <td class="content"><?php echo $tenqg; ?></td>
					  </tr>
					 </table>
					 <p align="center"> 
					  <input name="btnModifySchool" type="button" id="btnModifySchool" value="Sửa trường" onClick="window.location.href='index.php?view=modify&id=<?php echo $id; ?>';" class="box">
					  &nbsp;&nbsp;
					  <input name="btnBack" type="button" id="btnBack" value=" Trở về " onClick="window.history.back();" class="box">
					 </p>
					</form>
				</div>
			</div>
